<template>
  <main class="content">
    <div class="list">
      <!-- 历史搜索 -->
      <span class="clr"
        >历史搜索
        <van-icon class="del" name="delete-o" />
      </span>
      <ul class="goods">
        <li class="show1">111</li>
        <li class="show1">111</li>
        <li class="show1">111</li>
      </ul>

      <!-- 搜索发现 -->
      <div class="list">
        <span>搜索发现</span>
        <div class="li">
          <ul
            class="goods"
            v-for="item in goods"
            :key="item.keyword"
            @click="goSort(obj.keyword)"
          >
            <li class="show1" @click="leap">{{ item.keyword }}</li>
          </ul>
        </div>
      </div>
    </div>
  </main>
</template>

<script>
import {shop_search} from '../../api/index2'

export default {
  data() {
    return {
      goods: [],
      searchkey:'',
    };
  },
  methods: {
    goSort(a) {
      localStorage.setItem("this.keyword", a);
    },
    leap() {
      this.value=localStorage.getItem("this.keyword");
    },
  },
  created(){
    /* console.log("this.value",this.value); */
    shop_search({searchkey:localStorage.getItem("this.keyword")}).then((res)=>{
        if(res.data.code == 200){
          
            // alert('ok')a
        }
    })
  }
};
</script>

<style lang="css" scoped>
.clr {
  position: relative;
  display: block;
}
.van-icon {
  text-align: right;
  position: absolute;
  top: 0;
  right: 0;
  line-height: 3.5rem;
  color: rgb(24, 24, 64);
}
.content {
  flex: 1;
  overflow: auto;
  margin: 0 20px;
}
span {
  position: relative;
}
.del {
  position: absolute;
  top: -1.2167rem;
  left: 4.6667rem;
}
.show1 {
  height: 20px;
  border: 1px solid gray;
  color: gray;
  font-size: 12px;
  text-align: center;
  line-height: 20px;
  margin: 7px;
  padding: 0 5px;
  background-color: #efefef;
}

.goods{
    display: flex;
    width: 100%;
    flex-wrap: wrap;
}
</style>